Skip to content

fix: prevent data loss when parent folder moves during sync#141

Merged
camilasan merged 3 commits into
mainfrom
bugfix/prevent-data-loss-on-move
Jul 8, 2026
Merged

fix: prevent data loss when parent folder moves during sync#141
camilasan merged 3 commits into
mainfrom
bugfix/prevent-data-loss-on-move

Conversation

@camilasan

@camilasan camilasan commented Jul 6, 2026

Copy link
Copy Markdown
Member

todo - if everyone agrees with the changes:

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@camilasan camilasan changed the title Bugfix/prevent data loss on move fix: prevent data loss when parent folder moves during sync Jul 6, 2026
@camilasan camilasan force-pushed the bugfix/prevent-data-loss-on-move branch from 818392e to df78f74 Compare July 6, 2026 13:17
@camilasan camilasan requested a review from i2h3 July 6, 2026 13:17
@camilasan camilasan force-pushed the bugfix/prevent-data-loss-on-move branch 2 times, most recently from 6c44a59 to d7e6099 Compare July 6, 2026 13:24
Items with pending uploads and local origin lock files are protected
from deletion in the recursive directory delete path, so a moved or
renamed parent no longer wipes unsynced children. Pending upload items
are also skipped in the enumerator deletion pass, and reported changes
are sorted so parents come before children to avoid duplicate folders
on rename.

Backport of nextcloud/desktop#10134, adapted to the enumerator
architecture of the 3.2.x line. The 404 child deferral and move
reconciliation logic from master do not apply here.

Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Camila Ayres <hello@camilasan.com>
@camilasan camilasan force-pushed the bugfix/prevent-data-loss-on-move branch from d7e6099 to 58d4c41 Compare July 6, 2026 13:25

@i2h3 i2h3 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the actions.

camilasan added 2 commits July 7, 2026 22:44
NextcloudKit 7.3.x changed several signatures: upload and download now
report a raw response, uploadChunk was replaced by uploadChunkAsync, and
NKFile.tags became [NKTag]. Parse the metadata callers expect from the
response headers, provide a conforming downloadAsync wrapper, and switch
chunked upload to uploadChunkAsync, keeping the RemoteInterface protocol
and all call sites unchanged.

This makes the 3.2.x line build against NextcloudKit 7.3.x, which CI
resolves.

Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Camila Ayres <hello@camilasan.com>
NextcloudCapabilitiesKit 2.5.x requires ocs.data.version, so the inline
capability JSONs without it made Capabilities(data:) return nil and the
force unwrap in capabilitiesFromMockJSON crashed the test run. Add a
minimal version block to each mock.

Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Camila Ayres <hello@camilasan.com>
@camilasan camilasan force-pushed the bugfix/prevent-data-loss-on-move branch from e2f7e80 to 406b536 Compare July 7, 2026 20:53
@camilasan camilasan merged commit 50f2d73 into main Jul 8, 2026
4 of 5 checks passed
@camilasan camilasan deleted the bugfix/prevent-data-loss-on-move branch July 8, 2026 07:08
@camilasan

Copy link
Copy Markdown
Member Author

/backport to stable-3.0

@backportbot

backportbot Bot commented Jul 8, 2026

Copy link
Copy Markdown

The backport to stable-3.0 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable-3.0
git pull origin stable-3.0

# Create the new backport branch
git checkout -b backport/141/stable-3.0

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick 58d4c41b 363b7fa1 406b5361

# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/141/stable-3.0

Error: Failed to cherry pick commits: error: no cherry-pick or revert in progress
fatal: cherry-pick failed


Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants